home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 9 code / Tracks / drvr.a < prev    next >
Encoding:
Text File  |  1992-11-16  |  690 b   |  29 lines  |  [TEXT/MPS ]

  1. ; pascal Boolean UTLock(Boolean *flag);
  2. ; issue BSET on bit 0 of byte pointed to by flagbyte
  3. ; returns TRUE if bit was 0, returns FALSE if bit was already set
  4.  
  5. ; pascal calling conventions!!!
  6.  
  7. UTLOCK:        PROC    EXPORT
  8.  
  9.     MOVE.L    (SP)+,A0        ; return address
  10.     MOVE.L    (SP)+,A1        ; Boolean* argument
  11.     CLR.W    (SP)            ; clear function return value (=FALSE)
  12.     BSET    #0,(A1)            ; test and set bit
  13.     BNE.S    @1                ; skip around if bit was not zero
  14.     MOVE.W    #$0100,(SP)        ; if bit was zero, then return TRUE
  15. @1    JMP        (A0)            ; jump to return address
  16.     
  17.     ENDPROC    
  18.     
  19. UTPEEKA6:    PROC    EXPORT
  20.  
  21.     ; follows pascal calling conventions
  22.     
  23.     MOVE.L    A6,4(SP)        ; copy A6 onto stack where the function result goes
  24.     RTS
  25.     
  26.     ENDPROC
  27.  
  28.     
  29.     END